//
//  ClassfiyCollectionReusableView.m
//  UI_14_homework_UICollectionView
//
//  Created by li cheng on 16/8/2.
//  Copyright © 2016年 li cheng. All rights reserved.
//

#import "ClassfiyCollectionReusableView.h"

@interface ClassfiyCollectionReusableView()
@property (nonatomic, strong) UILabel *label;
@property (nonatomic, strong) UIButton *moreButton;
@end
@implementation ClassfiyCollectionReusableView
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        _label = [[UILabel alloc] init];
        [self addSubview:_label];
        _label.text = @"分类";
        _moreButton = [[UIButton alloc] init];
        [self addSubview:_moreButton];
        [_moreButton setTitle:@"查看更多>" forState:UIControlStateNormal];
        [_moreButton setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    }
    return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    [super applyLayoutAttributes:layoutAttributes];
    _label.frame = CGRectMake(0, 0, self.bounds.size.width / 3, 50);
    _moreButton.frame = CGRectMake(self.bounds.size.width / 3 *2,  0, self.bounds.size.width / 3, 50);
}

@end
